package com.fengmi.controller;

import com.fengmi.entity.BasicDic;
import com.fengmi.service.BasicDicService;
import com.fengmi.vo.InfoResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Author: 施俊豪
 * Date: 2022/1/25 17:22
 * Note: 系统基本信息控制器层
 */
@Api(description = "系统基本信息控制器")
@CrossOrigin
@RestController
@RequestMapping("/dic")
public class BasicDicController {
    @Autowired
    private BasicDicService basicDicService;

    @ApiOperation(value = "根据类别查询所有的基本信息")
    @RequestMapping("/findBasicDic/{name}")
    public InfoResult<List<BasicDic>> findBasicDic(@ApiParam("查询条件") @PathVariable("name")String name) {
        return basicDicService.findBasicDic(name);
    }
}
